<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src=".\js\jquery-3.7.1.min.js"></script>
    <script>
        $(function(){
            var $mydiv = $("#div");
            // alert($mydiv);
            // $mydiv.prev().css({"color":"red"});
            // $mydiv.next().css({"color":"blue"});
            $mydiv.find(".span").css({"color":"blue"});
        })
    </script>
</head>
<body>
    <h2>这是第一个标签</h2>
    <p>这是第二个标签</p>
    <div id="div">这是<span class="span">第三个</span>标签</div>
    <h2>这是第四个标签</h2>
    <p>这是第五个标签</p>
</body>
</html>